package com.eshipenet.shipnet.edpersistor

import org.json4s.{DefaultFormats, Formats}
import org.json4s.native.JsonMethods

import scala.util.Try

object EquipmentData {

  implicit val formats: Formats = DefaultFormats

  def parse(msg: String): Try[EquipmentData] = Try {
    JsonMethods.parse(msg).extract[EquipmentData]
  }

}

case class EquipmentData(equipment: Equipment,
                         model: EquipmentModel,
                         data: Map[String, EdgeChannelData],
                         timestamp: Long)
